<?php
    header("content-type:text/html;charset=utf8");
    $conn=new Mysqli("localhost","root","root","db_bailian");
    Mysqli_set_charset($conn,'utf8');
    if($conn->connect_errno){
        die("数据库连接失败！");
    }
    $sql1="select  count(pro_title) as 'num'  from t_commodity";
    $res1=$conn->query($sql1);
    $row1=Mysqli_fetch_assoc($res1);
    $result1=json_encode($row1);
    echo $result1;
?>